package com.hrt.datasender.datasent.serial;

import java.io.IOException;

import org.quartz.JobExecutionContext;

import com.btcode.schedule.SingleInstanceJob;

public class SerialSender extends SingleInstanceJob {

    private String msg = "##0062QN=201806011857034;ST=21;CN=9021;PW=123456;MN=TestLinRuiQiang;03C0\r\n";

    @Override
    public void initJob(JobExecutionContext arg0) {

    }

    @Override
    public void myExecute(JobExecutionContext arg0) {

        try {
            SerialManager.getInstance().out.write(msg.getBytes());
            SerialManager.getInstance().out.flush();
            System.out.println("发送串口数据成功");
        } 
        catch (IOException e) {
            e.printStackTrace();
        }
    }

}
